Image inpainting can reconstruct a lost or deteriorated part of an image. Some methods for image inpainting on flat surfaces have been known for some time. However, these known methods only work well on two-dimensional images, for example, images on flat surfaces. FIG. 1A shows an example of a flat surface, and FIG. 1B shows an example of a two-dimensional image on the flat surface. The existing methods do not work well on arbitrary three-dimensional images, i.e., images on arbitrary surfaces in three-dimensional space are not easily transferred to 2D space and the transformation will induce certain kind of distortion which affect the inpainting result. To improve the image inpainting technology and solve this problem, it is desirable to have a method for image inpainting on arbitrary surfaces in three-dimensional space.